package com.gc.server.enums;

import lombok.Getter;

import java.util.Arrays;


/**
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Oct 21 16:29:16 CST 2020
 */
@Getter
public enum BusApplyTypeEnum {


    LEAVE(0, "请假"),
    TRIP(1, "出差");


    int index;
    String value;

    public static String[] names() {
        return Arrays.stream(BusApplyTypeEnum.values()).map(m -> m.getValue()).toArray(String[]::new);
    }

    BusApplyTypeEnum(int index, String value) {
        this.index = index;
        this.value = value;
    }

    public static String indexOf(int idx) {
        return BusApplyTypeEnum.values()[idx].getValue();
    }

}
